package top.humbleyuan.leet.util;

import java.util.List;

/**
 * @Author HumbleYuan
 * @Date 2019/10/21 10:34
 * @Des
 */
public class MyListHandle {

    /**
     * List转String
     * @param list
     * 基本类型
     */
    public static <T> String ListToString(List<T> list) {
        StringBuilder str = new StringBuilder("[");
        for (T item:list)
            str.append(item + ",");

        str.replace(str.length() - 1,str.length(),"]");
        return str.toString();

    }
}
